#include <cstdio>
#include <map>
using namespace std;

const long long MOD = 1000000007;

// 快速幂取模
long long pow_mod(long long base, long long exp, long long mod) {
    long long res = 1;
    base %= mod;
    while (exp > 0) {
        if (exp & 1) {
            res = (res * base) % mod;
        }
        base = (base * base) % mod;
        exp >>= 1;
    }
    return res;
}

// 模逆元：a 在模 MOD 下的逆元
long long inv(long long a) {
    return pow_mod(a, MOD - 2, MOD);
}

// 质因数分解
void primeFactorize(long long n, map<long long, int>& factors) {
    for (long long d = 2; d * d <= n; ++d) {
        while (n % d == 0) {
            factors[d]++;
            n /= d;
        }
    }
    if (n > 1) {
        factors[n]++;
    }
}

int main() {
    int n;
    scanf("%d", &n);

    map<long long, int> totalFactors;

    for (int i = 0; i < n; ++i) {
        long long a;
        scanf("%lld", &a);  // 注意：%lld 读 long long
        primeFactorize(a, totalFactors);
    }

    long long result = 1;

    for (auto& kv : totalFactors) {
        long long p = kv.first;
        int exp = kv.second;

        // 计算 p^(exp+1) mod MOD
        long long power = pow_mod(p, (long long)exp + 1, MOD);
        long long numerator = (power - 1 + MOD) % MOD;  // 避免负数
        long long denominator = (p - 1) % MOD;

        long long term;
        if (denominator == 0) {
            // p == 1 的情况（理论上不会发生，p 是质数 ≥2）
            term = exp + 1;
        } else {
            term = numerator * inv(denominator) % MOD;
        }

        result = (result * term) % MOD;
    }

    printf("%lld\n", result);  // 输出 long long 用 %lld

    return 0;
}